//
//  CMDBUserCenterProductionTableView.swift
//  CMDB
//
//  Created by 曹桂祥 on 17/5/4.
//  Copyright © 2017年 CMDB. All rights reserved.
//

import UIKit

private let CMDBUserCenterProductionCellID = "CMDBUserCenterProductionCell"

class CMDBUserCenterProductionTableView: CMDBRefreshTableView {
    
    func setScrollViewContentOffSet(point:CGPoint) {
        if !self.mj_header.isRefreshing() {
            self.contentOffset = point
        }
    }

    override func setupTableView() {
        super.setupTableView()
        
        contentInset = UIEdgeInsets(top: 0, left: 0, bottom: 0, right: 0)
        
        self.registerClass(CMDBUserCenterProductionCell.self, forCellReuseIdentifier: CMDBUserCenterProductionCellID)
        
//        self.mj_header = MJRefreshNormalHeader { [weak self] in
//            guard let weak = self else {return}
//            
////            DispatchQueue.main.asyncAfter(deadline: .now() + .seconds(1), execute: {
////                // Put your code which should be executed with a delay here
////                weak.mj_header.endRefreshing()
////                weak.reloadData()
////                
////            })
//            
//        }
//        mj_header = MJR
        
    }
    
    override func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
        return 5
    }

    
    override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
        
        let cell = tableView.dequeueReusableCellWithIdentifier(CMDBUserCenterProductionCellID) as! CMDBUserCenterProductionCell
        
        cell.indexPath = indexPath
        
        cell.mDelegate = self
        
        return cell
        
//        return dequeCellAndLoadContentFromAdapter(tableViewAdapterArray![indexPath.row] , indexPath: indexPath, tableView: self, controller: self.controller,cellReuseIdentifier : TopicCellID)
        
    }
    
    override func tableView(tableView: UITableView, heightForRowAtIndexPath indexPath: NSIndexPath) -> CGFloat {
        
//        let viewModel = tableViewdataArray![indexPath.row] as! CMDBDynamicBean
        
        //return viewModel.cellHeight
        
        return 162
    }


}
